package com.ocgs.web.action.ajax;

import com.ocgs.base.core.web.action.BaseAction;
import com.ocgs.code.service.impl.CodeServiceImpl;

import java.util.List;


/**
 * @author bryant
 * @version 1.0
 * @since 2012-05-14
 *
 */
public class AjaxAction extends BaseAction {

    private static final long serialVersionUID = -2484651244734670052L;
    private CodeServiceImpl codeService;
    private String codeTypeId;
    private String codeId;
    private List jsonResult;

    public void setCodeService(CodeServiceImpl codeService) {
        this.codeService = codeService;
    }


    public void setCodeTypeId(String codeTypeId) {
        this.codeTypeId = codeTypeId;
    }

    public void setCodeId(String codeId) {
        this.codeId = codeId;
    }


    public void setJsonResult(List jsonResult) {
        this.jsonResult = jsonResult;
    }

    public List getJsonResult(){
        return this.jsonResult;
    }

    public String getChildCodeDesc() throws Exception {
       try{
           jsonResult = codeService.findChildCodeList(codeTypeId, codeId);
       }catch (Exception e){
           throw e;
       }
        return SUCCESS;
    }
}
